<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 坏了的计算器 -->
    <script>
      var brokenCalc = function (X, Y) {
        let ans = 0
        while (Y > X) {
          ans++
          if (Y % 2 == 1) Y++
          else Y /= 2
        }
        return ans + X - Y
      }
      console.log(brokenCalc(2, 3))
    </script>
  </body>
</html>
